Focusing apparatus, control method of focusing apparatus, and recording medium storing focus adjustment program

ABSTRACT

A focusing apparatus includes processing circuitry. The processing circuitry is configured to select an AF area indicating a defocus amount closest to a calculated moving object prediction equation among the latest defocus amounts detected for the plurality of AF areas, in a case where the moving object prediction equation is determined as being established, and the driving direction is determined as being the close-range direction. The moving object prediction equation is determined as being established when a divergence amount between the defocus amount equal to or larger than a predetermined number included in the history and the calculated moving object prediction equation is equal to or lower than a predetermined value.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation Application of PCT Application No.PCT/JP2017/036713, filed Oct. 10, 2017 and based upon and claims thebenefit of priority from the prior Japanese Patent Application No.2016-230273, filed Nov. 28, 2016, the entire contents of all of whichare incorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates generally to a focusing apparatus, acontrol method of focusing apparatus, and a recording medium storing afocus adjustment program.

2. Description of the Related Art

Jpn. Pat. Appln. KOKAI Publication No. 2007-199261 and Jpn. Pat. Appln.KOKAI Publication No. 2015-087706 propose a technology relating to an AFarea selection based on a defocus amount during an autofocus (AF)operation. For example, Jpn. Pat. Appln. KOKAI Publication No.2007-199261 discloses a technology for detecting an AF area in which amain subject exists based on a defocus amount, and Jpn. Pat. Appln.KOKAI Publication No. 2015-087706 discloses a technology in which an AFarea with a large defocus amount deviation, being an AF area in which amain subject does not exist, would be difficult to be selected.

However, with these technologies, especially for a perspective mixedsubject, it is not always possible to properly select an AF area. Forexample, when a subject on a close-range side is desired to bephotographed, there is a possibility that AF may be performed withrespect to the background on an infinity side. Under such circumstances,there is a demand for a technology that unfailingly performs AF on amain subject.

BRIEF SUMMARY OF THE INVENTION

According to an aspect of the invention, there is provided a focusingapparatus detecting a defocus amount repeatedly for each of a pluralityof AF areas and selecting an AF area based on the defocus amount toperform focus adjustment, wherein the focusing apparatus includesprocessing circuitry that is configured to calculate a moving objectprediction equation based on a history of a plurality of the repeatedlydetected defocus amounts, perform a first determination as to whether ornot the moving object prediction equation may be established, the movingobject prediction equation being determined as being established when adivergence amount between the defocus amount equal to or larger than apredetermined number included in the history and the calculated movingobject prediction equation is equal to or lower than a predeterminedvalue, and a second determination as to whether a driving direction of afocus lens calculated from the moving object prediction equation is aclose-range direction or an infinite direction, and in a case where themoving object prediction equation is determined as being established inthe first determination, and the driving direction is determined asbeing the close-range direction in the second determination, select anAF area indicating a defocus amount closest to the moving objectprediction equation among the latest defocus amounts detected for theplurality of AF areas.

According to an aspect of the invention, there is provided a method forcontrolling a focusing apparatus, the focusing apparatus detecting adefocus amount repeatedly for each of a plurality of AF areas andselecting an AF area based on the defocus amount to perform focusadjustment, the method including calculating a moving object predictionequation based on a history of a plurality of the repeatedly detecteddefocus amounts, performing a first determination as to whether or notthe moving object prediction equation is established, the moving objectprediction equation being determined as being established when adivergence amount between the defocus amount equal to or larger than apredetermined number included in the history and the calculated movingobject prediction equation is equal to or lower than a predeterminedvalue, and a second determination as to whether a driving direction of afocus lens calculated from the moving object prediction equation is aclose-range direction or an infinite direction, and in a case where themoving object prediction equation is determined as being established inthe first determination, and the driving direction is determined as theclose-range direction in the second determination, selecting an AF areaindicating a defocus amount closest to the moving object predictionequation among the latest defocus amounts detected for the plurality ofAF areas.

According to an aspect of the invention, there is provided acomputer-readable non-transitory storage medium storing a focusadjustment program for causing a computer to repeatedly detect a defocusamount for each of a plurality of AF areas, and to select the AF areaused for focus adjustment based on the defocus amount, wherein the focusadjustment program includes calculating a moving object predictionequation based on a history of a plurality of the repeatedly detecteddefocus amounts, performing a first determination as to whether or notthe moving object prediction equation is satisfied, the moving objectprediction equation being determined as being established when adivergence amount between the defocus amount equal to or larger than apredetermined number included in the history and the calculated movingobject prediction equation is equal to or lower than a predeterminedvalue, and a second determination as to whether a driving direction of afocus lens calculated from the moving object prediction equation is aclose-range direction or an infinite direction, and in a case where themoving object prediction equation is determined as being established inthe first determination, and the driving direction is determined as theclose-range direction in the second determination, selecting an AF areaindicating a defocus amount closest to the moving object predictionequation among the latest defocus amounts detected for the plurality ofAF areas.

Advantages of the invention will be set forth in the description whichfollows, and in part will be obvious from the description, or may belearned by practice of the invention. The advantages of the inventionmay be realized and obtained by means of the instrumentalities andcombinations particularly pointed out hereinafter.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate embodiments of the invention, andtogether with the general description given above and the detaileddescription of the embodiments given below, serve to explain theprinciples of the invention.

FIG. 1 is a block diagram showing an example of a configuration of afocusing apparatus 1 according to an embodiment.

FIG. 2A is a flowchart showing an example of focusing apparatus controlprocessing according to an embodiment.

FIG. 2B is a flowchart showing an example of focusing apparatus controlprocessing according to an embodiment.

FIG. 3 is a schematic diagram showing an example of a plurality of AFareas according to an embodiment.

FIG. 4 is a schematic diagram showing an example of a unit in which acorrection amount is calculated in the case of an all-target accordingto an embodiment.

FIG. 5 is a schematic diagram showing an example of an AF calculationexecution range in the case of a group-target in first area selectionprocessing according to an embodiment.

FIG. 6 is a schematic diagram showing an example of an AF calculationexecution range in the case of a group-target in first area selectionprocessing according to an embodiment.

FIG. 7 is a schematic diagram showing an example of an AF calculationexecution range in the case of an all-target in first area selectionprocessing according to an embodiment.

FIG. 8 is a schematic diagram showing an example of a face detectionrange and an AF calculation execution range in the case of face AF infirst area selection processing according to an embodiment.

FIG. 9 is a schematic diagram showing an example of a priority order ofselection of AF areas included in an AF calculation execution range inthe case of face AF in first area selection processing according to anembodiment.

FIG. 10 is a schematic diagram showing an example of an AF calculationexecution range at a time of tracking AF in second area selectionprocessing according to an embodiment.

FIG. 11 is a schematic diagram showing an example of an AF areaselection in a first case according to an embodiment.

FIG. 12 is a schematic diagram showing an example of an AF areaselection in a second case according to an embodiment.

FIG. 13 is a schematic diagram showing an example of an AF areaselection in a third case according to an embodiment.

FIG. 14 is a schematic diagram showing an example of a relationshipbetween a defocus amount distribution for an AF area and a current lensposition and a true focusing position in the case where a control aimingat defocus amount=0 is performed according to an embodiment.

FIG. 15 is a schematic diagram showing an example of a relationshipbetween a defocus amount distribution for an AF area and a current lensposition and a true focusing position in the case where a control aimingat defocus amount=+1Fδ is performed according to an embodiment.

DETAILED DESCRIPTION OF THE INVENTION First Embodiment

<Configuration of Focusing Apparatus>

Hereinafter, a first embodiment of the present invention will beexplained with reference to the drawings. A configuration of a focusingapparatus 1 according to an embodiment of the present invention is shownas a block diagram in FIG. 1. The focusing apparatus 1 is an example ofan imaging apparatus, and also an example of a camera system. In FIG. 1,an arrowed solid line indicates the flow of data, and an arrowed brokenline indicates the flow of a control signal.

As shown in FIG. 1, the focusing apparatus 1 according to the presentembodiment includes an interchangeable lens 100 and a camera body 200.The interchangeable lens 100 is configured to be attachable to anddetachable from the camera body 200. The interchangeable lens 100 andthe camera body 200 are connected so that they can communicate with eachother when the interchangeable lens 100 is attached to the camera body200. The focusing apparatus 1 does not necessarily have to be a camerasystem with interchangeable lenses. For example, the focusing apparatus1 may be a lens integrated camera system.

The interchangeable lens 100 as a lens unit includes an imaging opticalsystem 102, a drive unit 104, a lens CPU 106, and a lens-side storageunit 108.

The imaging optical system 102 is an optical system for forming an imageof a subject light flux on an imaging element 208 of the camera body200. The imaging optical system 102 includes a focus lens 1021 and anaperture 1022. The focus lens 1021 is configured to be able to adjust afocal position of the imaging optical system 102 by moving in an opticalaxis direction. The aperture 1022 is disposed on an optical axis of thefocus lens 1021. The aperture diameter of the aperture 1022 is variable.The aperture 1022 adjusts the subject light flux passing through thefocus lens 1021 and entering the imaging element 208. The drive unit 104drives the focus lens 1021 and the aperture 1022 based on a controlsignal that is output from the lens CPU 106. Here, the imaging opticalsystem 102 may be configured as a zoom lens. In this case, the driveunit 104 also performs a zoom drive.

The lens CPU 106 is configured communicably with a CPU 216 of the camerabody 200 through an interface (I/F) 110 that serves as a lenscommunication unit. The lens CPU 106 functions as a focus control unit.The drive unit 104 performs focusing operation under the control of theCPU 216. Furthermore, the lens CPU 106 transmits information, such as anaperture value (F-number) of the aperture 1022 and lens informationstored in the lens-side storage unit 108, to the CPU 216 through the I/F110. The lens-side storage unit 108 stores lens information regardingthe interchangeable lens 100. The lens information includes, forexample, information on a focal distance of the imaging optical system102 and aberration information.

The camera body 200 includes a mechanical shutter 202, a drive unit 204,an operation unit 206, the imaging element 208, imaging controlcircuitry 210, an analog processor 212, analog-to-digital processingcircuitry (ADC) 214, the CPU 216, an image processor 218, an imagecompression/expansion unit 220, focus detection circuitry 222, a display224, a bus 226, a DRAM 228, a body-side storage unit 230, a recordingmedium 232, tracking circuitry 234, and face detection circuitry 236.

The mechanical shutter 202 is configured to be openable/closable, andadjusts an incidence time of a light flux from a subject to the imagingelement 208 (an exposure time of the imaging element 208). As themechanical shutter 202, for example, a focal-plane shutter is employed.The drive unit 204 drives the mechanical shutter 202 based on a controlsignal from the CPU 216.

The operation unit 206 includes a focusing instruction unit 206 a. Thefocusing instruction unit 206 a includes, for example, a release button,and outputs a control signal for starting focusing in response to anoperation, such as a first release, by a user. That is, the focusinginstruction unit 206 a instructs start of a focus adjustment. Theoperation unit 206 includes various types of operation buttons, such asa power button, a movie button, a playback button, and a menu button,and various types of operation members, such as a touch panel. Theoperation unit 206 senses an operation state of various types ofoperation members, and outputs a signal indicating a sense result to theCPU 216.

The imaging element 208 is arranged on an optical axis of the imagingoptical system 102, behind the mechanical shutter 202, and at a positionwhere the imaging optical system 102 forms an image of the subject lightflux. The imaging element 208 is configured by two-dimensionallyarranging light-receiving portions (for example, photodiodes) thatconfigure pixels. The light-receiving portions configuring the imagingelement 208 generate electric charges corresponding to the amount ofreceived light. The electric charge generated in the light-receivingportion is accumulated in a capacitor connected to each light-receivingportion. The electric charge accumulated in this capacitor is read outas a pixel signal in accordance with a control signal from the imagingcontrol circuitry 210. Here, the imaging element 208 may have focusdetection pixels.

The imaging control circuitry 210 controls the exposure of the imagingelement 208 and the reading of the pixel signals from the imagingelement 208 in accordance with a readout setting of a pixel signal fromthe imaging element 208.

The analog processor 212 performs analog processing, such asamplification processing, on the pixel signal read from the imagingelement 208 under the control of the imaging control circuitry 210. AnADC 214 converts the pixel signal output from the analog processor 212into digital format pixel data. In the following explanation, acollection of pixel data will be referred to as image data.

The CPU 216 is a control unit that performs overall control of thefocusing apparatus 1 according to a program stored in the body-sidestorage unit 230. The CPU 216 includes a moving object prediction unit216 a, a determination unit 216 b, and a sensitivity setting unit 216 c.

The moving object prediction unit 216 a calculates a moving objectprediction equation based on a history of a plurality of repeatedlydetected defocus amounts. The history includes, for example, a historyof past distance measurement results (defocus amount or drive positionof the focus lens 1021) stored in the DRAM 228. The plurality of defocusamounts are repeatedly detected by, for example, the focus detectioncircuity 222 to be described later.

The determination unit 216 b determines (first determination) whether ornot the moving object prediction equation may be established. Thedetermination unit 216 b also determines (second determination) whethera driving direction of the focus lens obtained by the moving objectprediction equation is a close-range direction or an infinite direction.The second determination can also be expressed as a determination onwhether the inclination of the moving object prediction equation ispositive (the driving direction is a close-range direction) or negative(the driving direction is an infinite direction) when a vertical axisexpresses a lens position, and a horizontal axis expresses time. In theexplanation in the present embodiment, when the defocus amount ispositive, it means that there is a certain focus deviation amount, and afocus deviation direction is on the close-range direction side. However,it is needless to say that whether the defocus amount, or theinclination of the moving object prediction equation, etc. is positiveor negative can be changed depending on, for example, which of the lensdriving directions is a positive direction. As will be described indetail later, the determination unit 216 b further performs adetermination (third determination) as to whether or not a defocusamount that is a minimum value of an absolute value of a positivedefocus amount, and is a defocus amount smaller than a predeterminedfactor of times of a minimum value of an absolute value of a negativedefocus amount exists among the detected plurality of defocus amounts,or as to whether or not the positive defocus amount is sufficientlysmall.

As will be described later, the determination unit 216 b may alsoperform evaluation on the accuracy of the moving object predictionequation, such as to what extent the calculated moving object predictionequation complies with the history information of the defocus amount.Furthermore, the accuracy of the moving object prediction equationevaluated in such manner can also be expressed as, for example,reliability of the moving object prediction equation, or the precisionof the moving object prediction equation, etc.

The sensitivity setting unit 216 c sets sensitivity of focus adjustment.For example, high sensitivity is set when a user intends to have the AFfollow an intensely moving subject that suddenly accelerates or suddenlydecelerates. A plurality of predetermined values that are selectablefrom, for example, “high”, “standard”, or “low”, may be prepared for thesensitivity, or a user may set an appropriate value for the sensitivity.

The image processor 218 performs various types of image processing onpixel data. For example, when recording a still image, the imageprocessor 218 performs image processing for still image recording.Similarly, when recording a movie image, the image processor 218performs image processing for movie image recording. Furthermore, whendisplaying a live view, the image processor 218 performs imageprocessing for display.

When recording the image data, the image compression/expansion unit 220compresses the image data (still image data or movie image data)generated by the image processor 218. Furthermore, when reproducing theimage data, the image compression/expansion unit 220 expands the imagedata that is recorded in a compressed state in the recording medium 232.

The focus detection circuitry 222 performs a defocus amount calculationfor calculating the defocus amount (the focus deviation direction andthe focus deviation amount) with respect to the focusing position of thefocus lens 1021. In the case where the focus detection pixels areprovided in the imaging element 208, the focus detection circuitry 222acquires the pixel data from the focus detection pixels and, based onthe acquired pixel data, calculates the defocus amount with respect tothe focusing position of the focus lens 1021 using a phase differencesystem. The focus detection circuitry 222 then calculates the lensposition at which the focus lens 1021 should be driven based on thedefocus amount. In the following explanation, the focus detectioncircuitry 222 is assumed as detecting the defocus amount by the phasedifference system using the focus detection pixels. However, the focusdetection circuitry 222 may detect the defocus amount using varioustypes of systems other than the phase difference system using the focusdetection pixels. For example, the focus detection circuitry 222 maydetect the defocus amount from a pair of pieces of image data outputfrom a distance measuring sensor that is different from the focusdetection pixel. The focus detection circuitry 222 includes areliability determination unit 222 a. The reliability determination unit222 a performs reliability determination on the detection of the defocusamount, that is, reliability of an interval value of two images(two-image internal value).

The display 224 is, for example, a display unit such as a liquid crystaldisplay or an organic EL display, and is disposed on, for example, theback of the camera body 200. The display 224 displays an image inaccordance with the control of the CPU 216. The display 224 is used uponlive-view display or display of a recorded image, etc.

The bus 226 is connected to the ADC 214, the CPU 216, the imageprocessor 218, the image compression/expansion unit 220, the focusdetection circuitry 222, the DRAM 228, the body-side storage unit 230,and the recording medium 232, and functions as a transfer path fortransferring various kinds of data present in these blocks.

The DRAM 228 is a memory that is electrically rewritable, andtemporarily stores various types of data, such as the above-mentionedimage data (pixel data), image data for recording, image data fordisplay, and processing data in the CPU 216. An SDRAM may also be usedfor temporarily storing data. The body-side storage unit 230 storesvarious types of data, such as programs used in the CPU 216, andadjustment values of the camera body 200. The recording medium 232 isconfigured to be built or installed in the camera body 200, and recordsthe image data for recording as an image file in a predetermined format.The DRAM 228, the body-side storage unit 230, and the recording medium232 may be configured respectively by one memory, or by a combination ofa plurality of memories, etc.

The tracking circuitry 234 tracks moving subjects, such as movingchildren and pets. The face detection circuitry 236 detects whether ornot the subject includes a face. In the case where a face is included,the tracking circuitry 234 detects the face position within the angle ofview. Hereinafter, in the present embodiment, a region including a facedetected by the face detection circuitry 236 is described as a facedetection range. Furthermore, the face detection circuitry 236 includespupil detection circuitry. The pupil detection circuitry detects, forexample, the presence or absence of a pupil and the position of a pupil,etc. within the face detection range detected by the face detectioncircuitry 236.

The lens CPU 106, the CPU 216, and each unit of the CPU 216 includeintegrated circuits, etc., such as a central processing unit (CPU), anapplication specific integrated circuit (ASIC), a field programmablegate array (FPGA), a digital signal processor (DSP), or a graphicsprocessing unit (GPU). The CPU 216 and each unit of the CPU 216 may beconfigured respectively by one integrated circuit, etc., or may beconfigured by a combination of a plurality of integrated circuits, etc.The operations of these integrated circuits, etc. are performed inaccordance with a program recorded in, for example, a recording areainside the lens-side storage unit 108, the body-side storage unit 230,or the integrated circuit, etc.

<Operation of Focusing Apparatus>

An example of the focusing apparatus control processing according to thepresent embodiment is shown in FIG. 2A and FIG. 2B as flowcharts. Theoperation of the focusing apparatus 1 will be explained with referenceto these drawings.

In step S101, the CPU 216 turns on the power of the camera based on, forexample, an operation signal output by the operation unit 206 inaccordance with a user's operation.

In step S102, the CPU 216 determines whether or not a first releaseswitch is in an ON-state based on, for example, an operation signaloutput by the focusing instruction unit 206 a in accordance with theuser's operation. The first release switch is, for example, a switchthat is turned on in response to a half press operation of the releasebutton by the user. In the case where the first release switch isdetermined as being in an ON-state, the focusing apparatus controlprocessing proceeds to step S104, and, in the case where it is not, thefocusing apparatus control processing proceeds to step S103.

In step S103, the CPU 216 imports image data for a live view (LV)display. The CPU 216 first causes a control signal of the drive unit 204to be switched so that the mechanical shutter 202 reaches a fully-openstate, and outputs a control signal to the lens CPU 106 so as to drivethe aperture 1022. The CPU 216 starts an exposure operation for the LVdisplay by the imaging element 208 after a lapse of a predetermined timefor allowing the aperture 1022 to be opened and the mechanical shutter202 to be fully-opened. The frame rate of the exposure operation for theLV display is, for example, 60 fps. Furthermore, the image processor 218performs correction processing on the pixel data from the focusdetection pixel. By this correction processing, the pixel data from thefocus detection pixel can be used for the LV display in the same manneras the pixel data from the imaging pixel. After this correctionprocessing, the image processor 218 performs other processing necessaryfor generating image data for the LV display to generate image data fordisplay. Based on the image data for display generated by the imageprocessor 218, the CPU 216 causes the display 224 to display the LVimage. Subsequently, the focusing apparatus control processing returnsto step S102. In the manner described above, the processing relating tothe LV display in step S103 is repeated until it is determined in stepS102 that the first release switch is in an ON-state.

In step S104, the CPU 216 imports image data for autofocus (AF). At thistime, the CPU 216 starts an exposure operation for the AF by the imagingelement 208. The exposure time in the exposure operation for the AF maybe made different from the exposure time in the exposure operation forthe LV display. Furthermore, in the exposure operation for the AF, thepixel signal may be read from only the focus detection pixel.

In step S105, the reliability determination unit 222 a performsreliability determination of a two-image interval value. Here, anexample of a plurality of AF areas according to the present embodimentis schematically shown in FIG. 3, with reference to which thereliability determination of the two-image interval value according tothe present embodiment will be explained. In the present embodiment, asshown in FIG. 3, an example of a case in which eleven AF areas A1 arearranged vertically and horizontally, and an entire AF area AO isconfigured by 121 AF areas is explained. The reliability determinationaccording to the present embodiment is performed, for example, in eachAF area included in the entire AF area AO. Depending on how the focusdetection pixels are arranged, the two-image interval value can beobtained in each of the two phase difference detection directions of thevertical direction and the horizontal direction with respect to one AFarea. In this case, the reliability determination according to thepresent embodiment is performed for the vertical direction and thehorizontal direction in each of the 121 AF areas. In the reliabilitydetermination according to the present embodiment, it is determinedwhether or not the contrast amount of a focus detection pixel output issufficient, whether or not a minimal value in a correlation calculationresult is sufficiently small, and whether or not an inclination FS issufficient between the minimal value in the correlation calculationresult and a larger value of the correlation calculation results amongthe correlation calculation results at both adjacent sides of a positiontaking the minimal value (whether or not the edges assume a V-shape).The processing after step S105 in the focusing apparatus controlprocessing according to the present embodiment is executed only for theAF area that is determined as satisfying all of the above threedetermination conditions as a result of performing the reliabilitydetermination. The description herein does not exclude performing theprocessing thereafter for the AF area that does not satisfy all of theabove three conditions. In addition, a threshold value of thereliability determination may also be set separately for performing areaselection and for performing focus determination. When performing areaselection, a strict threshold value is set to perform area selectionstably, and when performing focus determination, etc., a threshold valuethat is at a borderline level of securing accuracy is set.

However, the determination condition in the reliability determination isnot limited to the above three conditions; therefore, other conditionsmay be added, or one of the three conditions may be omitted.Furthermore, the determination on whether or not each AF area satisfiesthe conditions may also be in a form where the extent of how much theconditions are satisfied is calculated as a numerical value, and thereliability is evaluated based on such numerical value.

With reference to FIG. 2A and FIG. 2B, the explanation on the operationof the focusing apparatus 1 will be continued. In step S106, the focusdetection circuitry 222 calculates the defocus amount (the focusdeviation direction and the focus deviation amount) with respect to thefocusing position of the focus lens 1021 by a phase difference systemusing the pixel data acquired from the focus detection pixel. In thepresent step, the two-image interval value (an image deviation amountindicating a minimum correlation calculation result) of each AF area ismultiplied by a sensitivity value that differs for each AF area, and thedefocus amount is calculated as, for example, a value in millimeters.Furthermore, a best contrast deviation correction amount of the imagingoptical system (generally, a frequency deviation amount of an imagingoptical system), which is a correction amount that differs for each AFarea, is added to the defocus amount. The correction amount can also beexpressed as an optical correction amount. The optical correction amountis stored in, for example, the body-side storage unit 230. Furthermore,in the present step, in order to perform moving object prediction, thefocus detection circuitry 222 also performs processing for convertingthe defocus amount into a focus lens position (lens pulse position). Inthis conversion, the focus detection circuitry 222 according to thepresent embodiment converts the defocus amount into a pulse position byusing an approximation equation for each defocus amount with respect tothe current lens position. The approximation equation is, for example, acubic equation determined for each interchangeable lens. Here, afocusing pulse position, which is a focusing lens position, iscalculated by an equation expressed as focusing pulse position=currentlens position (lens pulse position)+a×cube of defocus amount+b×square ofdefocus amount+c×defocus amount. The coefficients of a, b, and c in theequation are values uniquely determined for each imaging optical systemdepending on a zoom value of the imaging optical system and the currentlens position.

In the case where a calculation time relating to the addition of thecorrection amount is desired to be reduced, the focus detectioncircuitry 222 performs processing, for example, in the following manner.For example, in the case where an AF area setting is a group-targetusing 5 points or 9 points, etc. out of 121 points, only the correctionamount in one AF area included in the group is calculated, and the samecorrection amount is applied as a temporary correction amount to all ofthe AF areas included in the group.

Furthermore, for example, in the case where the AF area setting is anall-target using all 121 AF areas, as in the case of the group-targetdescribed above, the same correction amount is applied as a temporarycorrection amount to each collective region. An example of a calculationunit of the correction amount in the case of the all-target is shown asa schematic diagram in FIG. 4. For example, the correction amount iscalculated for each correction amount calculation execution range A2including a plurality of AF areas A1, and as shown by a thick frame linein FIG. 4. The correction amount calculation execution range A2includes, for example, a plurality of AF areas, such as 9 points (3×3)at the center, 6 points (3×2) above and below the center, 6 points (2×3)on the left and right of the center, and 4 points (2×2) in other ranges.Here, for example, as the correction amount of the AF areas included inthe correction amount calculation execution range A2, the correctionamount in an AF area A3 included in the correction amount calculationexecution range A2 is adopted as a temporary correction amount. Forexample, the AF area A1 indicated by hatching in FIG. 4 is selected asthe AF area A3. For example, as shown in FIG. 4, the AF area A3 isdisposed at positions closest to the center of the imaging element 208among the AF areas A1 included in each of the correction amountcalculation execution ranges A2; however, the AF area A3 is not limitedthereto. Any AF area A1 among the AF areas A1 included in each of thecorrection amount calculation execution ranges A2 may be selected as theAF area A3.

Therefore, the calculation of the correction amount can be achieved bythe calculation time required for 25×2 directions, and not for 121times×2 directions. When calculating a final defocus amount to drive thelens, the focus detection circuitry 222 may finally calculate thecorrect correction amount with respect to the AF area selected by thearea selection processing described later.

In step S107, the CPU 216 performs first area selection processing.Details of the first area selection processing will be described later;however, in the present processing, an AF area indicating the closestdefocus amount is selected based on the value of the defocus amountcalculated in step S106. Furthermore, the first area selectionprocessing is performed after the first release is pressed until thefocus determination is once performed.

In step S108, the CPU 216 determines whether or not the focus lens 1021is in a focused state. Such determination is performed, for example, bydetermining whether or not the defocus amount is within a presetpermissible range. Details of this determination will be describedlater. In the case where the focus lens 1021 is not determined as beingin the focused state, the focusing apparatus control processing proceedsto step S109. In the case where the focus lens 1021 is determined asbeing in the focused state, the focusing apparatus control processingproceeds to step S110.

In step S109, the CPU 216 outputs a control signal to the lens CPU 106so that the focus lens 1021 is driven in accordance with the focus lensposition (lens pulse position). The lens pulse position is, for example,the focusing pulse position calculated by the focus detection circuitry222 based on the defocus amount in step S106. The lens CPU 106 acquiresthe control signal and drives the focus lens 1021 through the drive unit104. Subsequently, the focusing apparatus control processing returns tostep S102.

In step S110, the CPU 216 starts exposure operations for AF and LV inthe same manner as the processing in step S104, and reads a pixelsignal. In step S111, the reliability determination unit 222 a performsreliability determination of a two-image interval value in the samemanner as the processing in step S105.

In step S112, the focus detection circuitry 222 calculates a defocusamount in the same manner as the processing in step S106. Furthermore,the focus detection circuitry 222 further performs processing ofconverting the defocus amount into a focus lens position (focusing pulseposition).

In step S113, the CPU 216 performs second area selection processing.Details of the second area selection processing will be described later;however, this processing is executed after the main subject is oncefocused (that is, while the first release is held).

In step S114, the CPU 216 performs processing to store historyinformation to be used for the moving object prediction calculation in,for example, the DRAM 228. The history information includes the lenspulse position based on the defocus amount corresponding to, forexample, the AF area selected in the second area selection processing.

In step S115, the moving object prediction unit 216 a starts the movingobject prediction calculation. The moving object prediction calculationis processing for predicting the current driving position of the focuslens 1021 from the history of the past distance measurement result (thedrive position of the focus lens 1021).

In step S116, the CPU 216 determines whether or not a second releaseswitch is turned on. The second release switch is a switch that isturned on in response to, for example, a full press operation of therelease button by the user. The focusing apparatus control processingproceeds to step S117 in the case where it is determined that the secondrelease switch is not turned on, and proceeds to step S118 when it isdetermined that the second release switch is turned on.

In step S117, the CPU 216 determines whether or not the focus lens 1021is in a focused state in the same manner as step S108. Details of thisdetermination will be described later. The focusing apparatus controlprocessing proceeds to step S118 in the case where it is not determinedthat the focus lens 1021 is in a focused state, and returns to step S110in the case where it is determined that the focus lens 1021 is in afocused state.

In step S118, the CPU 216 drives the focus lens in the same manner asstep S109. Subsequently, the focusing apparatus control processingreturns to step S110.

In step S119, the CPU 216 starts the operation of the mechanical shutter202 in order to perform main exposure of a still image continuousshooting. The operation of the mechanical shutter 202 includes anopen/close operation of the mechanical shutter 202 before and after themain exposure, and a fully-open operation of the mechanical shutter 202for starting the exposure operation for the live view and the AF afterthe main exposure. The CPU 216 first switches the control signal of thedrive unit 204 so that the mechanical shutter 202 reaches a fully-closedstate. After the main exposure is performed in step S121, the CPU 216controls the drive unit 204 so that the mechanical shutter 202 reaches afully-open state.

In step S120, the CPU 216 instructs the lens CPU 106 to simultaneouslydrive the focus lens 1021 and the aperture 1022, and starts theoperation. Here, in the present step, an instruction is given to drivethe aperture 1022 to be narrowed down to an aperture amount necessaryfor the still image continuous shooting determined in advance by anexposure amount calculation for Automatic Exposure (AE), etc.

In step S121, the CPU 216 starts the main exposure. The main exposure isan exposure operation for acquiring image data for recording. In themain exposure, the CPU 216 controls the drive unit 204 so that themechanical shutter 202 is opened/closed for only a predeterminedexposure period necessary for the still image continuous shooting. TheCPU 216 then starts an imaging operation of the imaging element 208during the exposure period. After the exposure period is ended, theimaging control circuitry 210 reads a pixel signal from each pixel ofthe imaging element 208. After the pixel signal is read, the imageprocessor 218 corrects the pixel output of the focus detection pixel,and performs processing for generating other image data for recording.After the image processing is completed, the image compression/expansionunit 220 compresses the image data for recording. After the compressionis completed, the CPU 216 records the compressed image data forrecording in the recording medium 232 as an image file.

In step S122, the CPU 216 instructs the lens CPU 106 to drive theaperture 1022. Here, in the present step, an instruction is given todrive the aperture 1022 to be opened to an opening amount (for example,an open aperture) necessary for live view exposure and for AF exposure.The processing in the present step may be performed in parallel with thereading of the pixel signal after the main exposure in step S121. Bysuch parallel processing, the display time of the live view image duringthe main exposure can be extended.

In step S123, similarly to step S104, the CPU 216 determines whether ornot the first release switch is in an ON-state. The focusing apparatuscontrol processing returns to step S110 when determined as being in thefirst release state, and proceeds to step S124 when not determined asbeing in the first release state.

In step S124, the CPU 216 determines whether or not to turn off thepower of the camera body 200. For example, in the case where the poweris instructed to be turned off by a user's operation of the operationunit 206, or in the case where the user's operation of the operationunit 206 is absent for a predetermined period of time, the power isdetermined to be turned off. The focusing apparatus control processingreturns to step S102 in the case where the power of the camera body 200is determined not to be turned off, and ends in the case where the powerof the camera body 200 is determined to be turned off.

<First Area Selection Processing>

Here, the first area selection processing in step S107 will be explainedin more detail. As in the case where it is determined in step S102 thatthe first release switch has been pressed, the first area selectionprocessing is performed after the focusing instruction unit 206 ainstructs start of the focus adjustment until the determination on thefocused state is once performed (focus determination) in step S108. Inthe first area selection processing, an AF area indicating a maximumvalue of the positive defocus amount (an AF area indicating a closestdefocus amount) is selected among the plurality of defocus amounts.

(Case of Single-Target)

In the case of a single-target, for example, as a result of a phasedifference detection in a vertical direction and a horizontal directionwithin one AF area that is designated by a user and a reliabilitydetermination of a two-image interval value, a phase differencedetection direction indicating a maximum value of the defocus amount isselected from the phase difference detection directions that aredetermined as having reliability, and the defocus amount indicated bythe phase difference detection direction is adopted. The AF area forwhich the phase difference detection calculation is performed may bereferred to as an AF calculation execution range.

(Case of Group-Target)

In the case of a group-target, a defocus amount is calculated in, forexample, a region including a plurality of AF areas such as a group of 5points or a group of 9 points designated by a user. FIG. 5 and FIG. 6each show an example of an AF calculation execution range in the case ofa group-target in the first area selection processing according to thepresent embodiment. An AF calculation execution range A4 of the group of5 points and an AF calculation execution range A5 of the group of 9points are regions surrounded respectively by a cross-shaped or arectangular-shaped thick frame line shown respectively in FIG. 5 or FIG.6. In the case of these group-targets, among the AF areas belonging togroups and among the AF areas determined to have reliability, an AF areaindicating a maximum value of the defocus amount is selected, and thedefocus amount indicated by such AF area is adopted.

The area selection may also be such that, after the AF area indicatingthe maximum value of the defocus amount is selected, in the same manneras in the case of the single-target, the phase difference detectiondirection indicating the maximum value of the defocus amount is furtherselected, and the defocus amount indicated by the phase differencedetection direction is adopted. The area selection may also be such thatthe phase difference detection direction indicating the maximum value ofthe defocus amount is selected among the phase difference detectiondirections included in the AF area belonging to the group and determinedto have reliability, and the defocus amount indicated by the phasedifference detection direction is adopted.

(Case of all-Target)

In the case of an all-target, an AF area indicating a center-prioritizedpositive defocus amount is selected. An example of an AF area (prioritycalculation range) preferentially selected in the case of all-target inthe first area selection processing according to the present embodimentis shown in FIG. 7. The center 25 AF areas (first priority calculationrange A6) surrounded by a thick frame line in FIG. 7 are selected withthe highest priority. Subsequently, the center 49 AF areas (secondpriority calculation range A7) surrounded by a thick frame line in FIG.7 are selected. In the case of the all-target, the AF calculationexecution range is the total 121 AF areas AO, and the first prioritycalculation range A6 and the second priority calculation range A7 areincluded in the AF calculation execution range.

First, the center 25 AF areas (first priority calculation range A6) ofthe total 121 AF areas AO (AF calculation execution range) as shown inFIG. 7 are considered. In the case where there is an AF area determinedto have reliability in the first priority calculation range A6, thedefocus amount of the AF area indicating a positive defocus amount isadopted therefrom.

On the other hand, in the case where there is no AF area determined tohave reliability in the first priority calculation range A6, the center49 AF areas (second priority calculation range A7) as shown in FIG. 7are considered. In the case where there is an AF area determined to havereliability in the second priority calculation range A7, the defocusamount of the AF area indicating the closest defocus amount is adoptedtherefrom.

Furthermore, there may be a case in which neither the first prioritycalculation range A6 nor the second priority calculation range A7include an AF area that is determined to have reliability. In such acase, the defocus amount of the AF area indicating the closest defocusamount is adopted among the AF areas determined to have reliabilitywithin the total 121 AF areas AO (AF calculation execution range).

In the same manner as in the case of the group-target, the areaselection in the case of the all-target may also be performed regardingthe defocus amount indicated by the phase difference detectiondirection.

(Case of Tracking AF)

In the case of tracking AF, first, the AF area is selected and thedefocus amount is acquired based on the AF area setting of thesingle-target, the group-target, or the all-target described above.However, in the case of the tracking AF, the AF area is updated asneeded based on the movement (tracking result) of the subject.

(Case of Face AF)

FIG. 8 shows an example of a face detection range and an AF calculationexecution range in the case of face AF in the first area selectionprocessing according to the present embodiment. In the case of the faceAF, an AF calculation execution range A9 is determined based on a facedetection range A8 in which a face F0 exists. An AF area closest to theposition of a pupil (pupil position F1 or pupil position F2) is thenpreferentially selected among the AF areas determined to havereliability within the AF calculation execution range A9. In the casewhere the AF area in the vicinity of the pupil position is not reliable,the AF area at the center of the face is preferentially selected.

Here, FIG. 9 shows the order of priority in which the AF area includedin the AF calculation execution range A9 is selected in the case shownin FIG. 8. Numerals shown in FIG. 9 represent the priority order inwhich each AF area included in the AF calculation execution range A9 isselected, indicating the smaller the number, the higher the priorityorder.

In the case of the face AF according to the present embodiment, sincethe AF area closest to the pupil position (the pupil position F1 or thepupil position F2) is preferentially selected, the AF area of position 1or 2 in FIG. 9 is selected. Here, in the case where both AF areas ofpositions 1 and 2 are determined to have reliability, a more reliable AFarea is selected between these AF areas.

On the other hand, in the case where neither AF areas of portions 1 nor2 are determined to have reliability, the AF area with the highestpriority ranking in FIG. 9 is preferentially selected among the reliableAF areas. As described above, in the face AF in the first area selectionprocessing, among the plurality of defocus amounts repeatedly detectedby the focus detection circuitry 222 in each AF area, the AF areacorresponding to the position of the pupil within the face detectionrange or the AF area determined to have high reliability is selected.

In the present embodiment, a case in which the face detection range A8is a 4×4 AF area has been explained; however, the present invention isnot limited thereto. The face detection range A8 may include a 3×3 or a5×5 AF area depending on the size of the face F0. Furthermore, the AFcalculation execution range A9 may change according to the size of theface detection range A8.

In the above explanation, the CPU 216 executes the first area selectionprocessing after the focusing instruction unit 206 a instructs to startthe focus adjustment until the focus determination is once made;however, the present invention is not limited thereto. For example, theCPU 216 may perform the same processing as the first area selectionprocessing when performing the exposure operation for the LV displaythat is repeatedly performed until it is determined that the firstrelease switch is in an ON-state. That is, until the focusinginstruction unit 206 a instructs to start focus adjustment, processingmay be performed in which the focus detection circuitry 222 selects anAF area that indicates the closest defocus amount among a plurality ofdefocus amounts repeatedly detected in each AF area. Furthermore, alsoin the face AF, for example, until the focusing instruction unit 206 ainstructs to start focus adjustment, processing may be performed inwhich the AF area corresponding to the position of the pupil within theface detection range or the AF area determined to have high reliabilityis selected from among the plurality of defocus amounts.

<Second Area Selection Processing>

Here, the second area selection processing in step S113 will beexplained. In the second area selection processing, the AF area isselected in the following manner after the main subject is once focused(that is, while the first release is held).

It is necessary to keep the main subject captured while the firstrelease is held. When in the above state where the main subject isfocused, unless the main subject moves, it would be correct for thevalue of the defocus amount to be zero. Furthermore, when consideringthe short exposure time, in the case where the main subject moves, sinceit is usually considered that the main subject is moving at a constantspeed and in a short distance, the AF area indicating the defocus amountaccording to the moving object prediction equation may be regarded asindicating a correct defocus amount.

Here, an AF calculation execution range for calculating the defocusamount in the second area selection processing will be explained. In thecase of a single-target, the defocus amount is calculated for each ofthe vertical direction and the horizontal direction in a selected AFarea (AF calculation execution range). In the case of a group-target,such as a group of 5 points and a group of 9 points, the defocus amountis calculated for each of the vertical direction and the horizontaldirection within the selected group-target (AF calculation executionrange). In the case of an all-target (121 points), the defocus amount iscalculated within the AF calculation execution range of, for example,5×5 points centered on the AF area selected last time. An example of theAF calculation execution range in tracking AF is schematically shown inFIG. 10, and will be explained with reference thereto. In the trackingAF, for example, as shown in FIG. 10, a defocus amount within the AFcalculation execution range of 3×3 points centering on a trackingcoordinate CO is calculated, and the AF area is selected based on thedefocus amount. In the face AF, a defocus amount within a range (facedetection range) where a face exists that is detected by the facedetection circuitry is calculated, and the AF area is selected based onthe defocus amount. In the face AF in the second area selectionprocessing, unlike the first area selection processing, processing.specific to the face AF is not performed. In the face AF in the secondarea selection processing, for example, as in the case of theabove-described group-target, the defocus amount is calculated for eachof the vertical direction and the horizontal direction within the facedetection range. However, this description does not exclude performingprocessing specific to the face AF in the second area selectionprocessing.

First, in the second area selection processing according to the presentembodiment, the determination unit 216 b determines (firstdetermination) whether or not a moving object prediction equation may beestablished. Here, the condition under which the moving objectprediction equation may be established is in the case where both of thefollowing two conditions (first condition and second condition) aresatisfied. The first condition is that there is history information onthe defocus amount for a certain number of points or more (for example,there is history information for 5 points or more within the past secondfrom the current time). The second condition is that, in a state wherethe first condition is satisfied, there are 5 or more points in whichthe divergence amount from a calculated primary prediction equation isequal to or lower than a certain amount (for example, 10Fδ). Asexplained with reference to the flowcharts of FIG. 2A and FIG. 2B, asthe moving object prediction equation, the result of the predictionequation calculated based on the distance measurement result up to theprevious one is used. In the description of Fδ, F indicates FNO (alsoreferred to as an F-number or an aperture value), δ indicates apermissible circle of confusion, and Fδ generally indicates apermissible depth. Furthermore, Fδ may also be described as 1Fδ.

The determination unit 216 b then determines (second determination)whether the driving direction of the focus lens 1021 obtained from themoving object prediction equation is the close-range direction or theinfinite direction. In the explanation of the present embodiment, thedirection (close-range direction) in which the focus lens 1021 is drivenfrom the infinity side toward the close-range side is defined aspositive, and a case in which the focus deviation direction is on theclose-range side is defined as a case in which the defocus amount ispositive. Here, if the subject is moving from the infinity side to theclose-range side, the inclination of the moving object predictionequation is positive when the vertical axis indicates the lens pulseposition and the horizontal axis indicates time. Obviously, depending onwhat is to be defined as positive, positive and negative of othervalues, and the inclination of the moving object prediction equation,etc. will change.

In the second area selection processing according to the presentembodiment, in the case where it is determined that the moving objectprediction equation is established in the first determination, and themoving object prediction equation has a positive inclination in thesecond determination (hereinafter referred to as a first case), an AFarea indicating the defocus amount closest to the moving objectprediction equation is selected. As described above, the first case is acase in which, for example, the lens is driven from the infinity side tothe close-range side. The first case may include a case in which theinclination of the moving object prediction equation is zero.

An example of selecting the AF area in the first case is schematicallyshown in FIG. 11, and will be explained in more detail with referencethereto. In the graph of FIG. 11, the vertical axis represents the lenspulse position calculated by the processing at S112, and the horizontalaxis represents time. In the graph of FIG. 11, a plot indicated by afilled circle represents the lens pulse position calculated, forexample, at each timing δt, and a solid line represents a moving objectprediction equation Eq1 calculated based on the history of the lenspulse position. The history includes, for example, the lens pulsepositions acquired from, for example, timing κ to timing n−1.Furthermore, plots of a plurality of non-filled circles (includingdouble circles pn) shown in the graph of FIG. 11 represent each of thelens pulse positions calculated based on each of the defocus amountsacquired in a plurality of AF areas determined to have reliability, at atiming n at which the current second area selection processing isperformed.

In the first case, among the plurality of lens pulse positions, the lenspulse position indicated by the double circle pn in FIG. 11, which isclosest to the moving object prediction equation Eq1, is selected.Therefore, in the first case, among the plurality of AF areas, the AFarea indicating the defocus amount used for calculating the lens pulseposition is selected. In the first case, whether or not the defocusamount is positive or negative is irrelevant.

The case in which the first case does not apply will now be explained.Here, among cases in which the first case does not apply, a case inwhich although the moving object prediction equation is established (thefirst determination is satisfied), the inclination of the moving objectprediction equation is negative (the driving direction of the focus lensis determined as the infinite direction in the second determination)will be explained as an example. Hereinafter, such a case is referred toas a second case. In the second case, for example, the lens is drivenfrom the close-range side toward the infinity side. Therefore, in thesecond case, for example, the AF area is selected so as not to selectthe AF area for which the defocus amount is calculated by focusing on abackground that is more on the infinity side than the main subject. Evenin the case where the moving object prediction equation is notestablished (the first determination is not satisfied) among the casesin which the first case does not apply, the same processing as theprocessing related to the AF area selection performed in the second caseexplained below is performed. As described above in the explanation ofthe first determination, the case in which the moving object predictionequation is not established includes a case in which the accuracy of themoving object prediction equation is low (the precision isinsufficient).

An example of selecting the AF area in the second case is schematicallyshown in FIG. 12, and will be explained in more detail with referencethereto. In the graph of FIG. 12, the items indicated by the verticalaxis and the horizontal axis, the items indicated by the type of eachplot, and the items indicated by the broken line are the same as thosein the graph of FIG. 11. In addition, the solid line in FIG. 12 shows amoving object prediction equation Eq2 that is calculated based on thehistory of the lens pulse position. In the graph of FIG. 12, thevertical axis and the axis indicating the defocus amount are describedon the same plane, however, the axes are of different dimensions fromeach other.

In the second case, as shown in the graph of FIG. 12, although themoving object prediction equation Eq2 is established, the inclination ofthe moving object prediction equation Eq2 is negative. In the secondcase, among the AF areas indicating each of the defocus amounts used forcalculating the plurality of focusing pulse positions indicated by plotsof unfilled circles at the position of timing n in the graph of FIG. 12,an AF area indicating a defocus amount that satisfies one of thefollowing two determinations (third determination, fourth determination)is selected. In the second case, regarding the defocus amount indicatedby the AF area determined to have reliability, the determination unit216 b determines (third determination) whether or not a defocus amountwith a positive value that satisfies a relationship of (minimum valueamong absolute values of defocus amount having a positivevalue)≤(minimum value of absolute value of defocus amount having anegative value)×constant exists. In addition, in the second case, thedetermination unit. 216 b does not perform the face AF, however,determines (fourth determination) whether or not the sensitivity set bythe sensitivity setting unit 216 c is higher than a predetermined value.In the case where it is determined that the third determination or thefourth determination is satisfied, the CPU 216 selects an AF areaindicating a minimum value of the positive defocus amount. Here, thesensitivity setting is a parameter that can be set by the user. Adisplay for sensitivity setting and an operation screen, etc. arepresent, for example, within a normal menu screen of the camera system.In the case where there is an AF area indicating, for example, defocusamount=0, it can be considered that the defocus amount satisfies thethird determination. In this manner, in the case where the second caseapplies, a positive defocus amount is preferentially adopted.

Furthermore, a case in which neither the first case nor the second caseapply, for example, a case in which the moving object predictionequation is not established, and the value of the defocus amount havinga positive value is large (hereinafter referred to as a third case) willbe explained. An example of selecting an AF area in the third case isschematically shown in FIG. 13, and will be explained in more detailwith reference thereto. Items indicated by each of the vertical axis,the horizontal axis, and the axis indicating the defocus amount in thegraph of FIG. 13, and items indicated by the type of each plot are thesame as those in FIG. 12. In such a third case, an AF area indicating aminimum value of the absolute value of the negative defocus amount isselected.

In the second area selection according to the present embodiment, it isdetermined whether or not there is a defocus amount that satisfies eachof the cases in the order of the first case, the second case, and thethird case, so that the defocus amount having a positive value is easilyadopted. The reason why the defocus amount having a positive value ismade easier to be adopted is to prevent a background, which, in mostcases, exist more distant than the subject, from being focused, forexample, in a perspective mixed subject. Therefore, obviously, theabove-described change in the order of determination, etc. performedfrom the viewpoint of facilitating the adoption of the positive defocusamount has the same purpose and may obtain the same effect as in thepresent technology.

Furthermore, the constant mentioned above in the second case is set toapproximately 10 times. The reason for this is to have a positivedefocus amount adopted as much as possible unless it is an extremelylarge positive defocus amount. Furthermore, the state of “sensitivityhigh” described in the second case indicates a state that is set in amanner to sensitively follow subjects, which is a state that, forexample, aims to also follow subjects that suddenly accelerate, etc. Thesensitivity setting is considered based on the purpose of activelyadopting a value of the positive defocus amount even if the value itselfis large, so that the subject coming closer from the far side may beeasily followed.

<Determination on Focused State (within Focusing Range)>

Here, the determination as to whether or not a focused state (within thefocusing range) exists in step S108 or S117 will be explained in moredetail. First of all, regarding an example of a situation required forthe focusing apparatus 1 according to the present embodiment, an exampleof a relationship between the defocus amount distribution with respectto the AF area in the case where a control aiming at the defocusamount=0 is performed and the current lens position and the truefocusing position is schematically shown in FIG. 14. The explanationwill be made with reference thereto. As described above, in the face AF,an AF area selection is performed by prioritizing a face center over aclosest defocus amount. Furthermore, in the following explanation, thedefocus amount indicated by each AF area is considered. However, a casein which each phase difference detection direction included in each AFarea may also be considered, in which naturally the same effect can beobtained.

In the graph of FIG. 14, the vertical axis represents the defocus amountand the horizontal axis represents the AF area. Each plot (def0, def1,def2, def3) in FIG. 14 represents the defocus amount calculated in eachAF area. Among the plots, a double circle plot def0 indicates thedefocus amount calculated in the AF area which is originally desired tobe selected, a filled circle plot def1 indicates the defocus amount tobe selected, a plot def2 denoted by “x” in the circle indicates thedefocus amount calculated with respect to the background miscellaneoussubject, and an unfilled circle plot def3 indicates other defocusamounts. In addition, in the graph of FIG. 14, a solid line shows thecurrent lens position where the current defocus amount is zero, a brokenline shows the true focusing position, an arrowed solid line D1 shows apermissible depth with respect to the current lens position, and anarrowed broken line D0 indicates a permissible depth with respect to thetrue focusing position. The true focusing position indicated by thebroken line and the permissible depth with respect to the true focusingposition indicated by the arrowed broken line D0 are values to be aimedat when preforming focus adjustment by the focusing apparatus 1;however, at the same time, are obviously unknown information that arenot grasped by the focusing apparatus 1 when performing the focusadjustment.

Generally, the permissible depth in the focus determination is set to,for example, −1Fδ to +1Fδ. However, in a situation where the AF isperformed on a perspective mixed subject as shown in FIG. 14, inaddition to the defocus amounts of such as the plot def0, the plot def1,and the plot def3, the defocus amount calculated in accordance with thebackground miscellaneous subject such as the plot def2 is also includedwithin the range of the permissible depth (indicated by the arrowedsolid line D1). Therefore, when the current lens position is at aposition, such as, −1Fδ from the true focusing position, due to thevariation of the detected defocus amount, as the plot def1, a defocusamount of an AF area that is slightly deviated from the AF area of theplot def0, which is originally desired to be selected, is selected.Furthermore, if it is further defocused to the negative side based onthe result of this selection, the lens would be driven little by littleto focus on a miscellaneous subject of the background, which may notallow an AF operation to appropriately focus on the main subject.

For example, in a continuous AF (C-AF) in which AF and focusing arerepeated in accordance with a moving subject, it is important to keeptrack of the subject normally moving forward. In the control processingof the focusing apparatus 1 according to the present embodiment, asdescribed above with reference to FIG. 2A and FIG. 2B, the lens drive(LD) (step S120) is executed based on the result of the movingprediction calculation immediately before the main exposure (step S121).

Therefore, the focusing apparatus 1 according to the present embodimentdoes not necessarily have to adjust the position of the focus lenswithin the permissible depth while the first release is being held.Furthermore, particularly in the C-AF, since it is important not tofocus on the background, as mentioned in the second area selectionprocessing, the focusing apparatus 1 according to the present embodimentpreferentially selects the defocus amount having a positive value.

Therefore, in the focus lens drive in step S118, the focusing apparatus1 according to the present embodiment performs control aiming at, forexample, defocus amount+1Fδ. An example of the relationship between thedefocus amount distribution for the AF area at this time and the currentlens position and true focusing position is schematically shown in FIG.15, and will be explained as follows with reference thereto. Itemsindicated by each of the vertical axis, the horizontal axis, the solidline, the broken line, the arrowed solid line D1, and the arrowed brokenline D0 in the graph of FIG. 15, and the items indicated by the type ofeach plot are the same as those in the graph of FIG. 14. Furthermore, anarrowed one-dot chain line D2 indicates a permissible depth with respectto the current lens position in the case where it is aimed at defocusamount=+1Fδ.

As described above with reference to FIG. 14, particularly in the casewhere a defocus amount in accordance with a background miscellaneoussubject is adopted in a perspective mixed subject, etc., the lens willbe driven to the infinity side of the true focusing position. Therefore,as shown in FIG. 15, the focusing apparatus 1 according to the presentembodiment drives the focus lens by adding an offset of, for example,“+1Fδ” as indicated by the solid line, on purpose, so that it takes avalue of a positive defocus amount from a true focusing positionindicated by the broken line. This can also be expressed as the focusingapparatus 1 according to the present embodiment performing focusadjustment by correcting the defocus amount indicated by the selected AFarea to a positive side by a predetermined amount. As a result, sincethere is a variation in the detected defocus amount, the focusingapparatus 1 according to the present embodiment adopts a defocus amount(plot def1) deviated from the true focusing position by approximately+1Fδ. Therefore, in the same manner as when the lens is driven (LD) toaim at defocus amount=0, the present technology is able to avoiddetecting the defocus amount in accordance with the miscellaneoussubject on the background. That is, the present technology is able toavoid adopting the defocus amount of the miscellaneous subject.

As described above, the focusing apparatus 1 according to the presentembodiment preferentially selects a defocus amount having a positivevalue in the second area selection processing, such as by performingcontrol to aim at, for example, defocus amount=+1Fδ, and sets thefocusing range of the focus determination in step S117 to expand to thenegative side, such as from −2Fδ to +1Fδ. This can also be expressed asthe focusing apparatus 1 according to the present embodiment performingthe focus determination by correcting the threshold in the focusdetermination to the negative side. That is, in the perspective mixedsubject, the focusing range is set within a permissible depth (arrowedone-dotted chain line D2) that may be obtained by combining apermissible depth that may be considered as corresponding to apermissible depth (arrowed broken line D0) with respect to a truefocusing position and a permissible depth (arrowed solid line D1) withrespect to the current lens position that is off-set driven. The lens isnot driven in the range of −2Fδ, to +1Fδ with respect to the currentlens position (defocus amount=0). In this manner, the present technologyis able to select an appropriate AF area for calculating a defocusamount in accordance with the main subject by making it difficult toselect the AF area indicating a defocus amount in accordance with abackground miscellaneous subject while suppressing the lens from beingdriven in the negative direction toward the background.

For example, when executing C-AF, etc., the focusing apparatus 1according to the present embodiment selects the closest defocus amountamong the defocus amounts indicated by the AF areas from immediatelyafter the first release is pressed until the focus determination isperformed. Furthermore, while the first release is pressed or duringcontinuous shooting, the focusing apparatus 1 according to the presentembodiment selects an AF area having the smallest defocus amount or anAF area indicating a defocus amount closest to the moving objectprediction calculation by the first to fourth determinations.Furthermore, the focusing apparatus 1 according to the presentembodiment performs control aiming at, for example, defocus amount=+1Fδin the focus determination.

In this manner, the focusing apparatus 1 according to the presentembodiment is able to prevent selecting an AF area indicating a defocusamount in accordance with a background miscellaneous subject. Therefore,by applying the present technology, even in the case of photographing aperspective mixed subject, a main subject indicating a closest defocusamount may be captured immediately after the first release is pressed,and an AF area indicating a defocus amount corresponding to the mainsubject, and not a background miscellaneous subject, can beappropriately selected.

Modification

The defocus amount of one AF area so far has been explained asindicating the two distance measurement results of the verticaldirection and the horizontal direction; however, the present inventionis not limited thereto. The defocus amount may be subdivided to afurther extent in the vertical direction and the horizontal direction.For example, there may be a case in which three defocus amounts arecalculated in the vertical direction, and three defocus amounts arecalculated in the horizontal direction. In the case of dividing thevertical direction and the horizontal direction further into three partsas in the manner described above, there may be a case in which, forexample, one AF area is divided into three positions, and the defocusamount is calculated in the three blocks of L, C, and R in each AF area.In this case as well, it is needless to say that the present technologycan realize the AF area selection by handling the AF area as 121×2(vertical and horizontal)×3 blocks.

However, in the case of calculating the defocus amount by furtherdividing the AF area in the above manner, the calculation amount of thedefocus amount increases together with the calculation time. In order toshorten the calculation time, for example, when performing blockselection, the block selection should be performed in the state of thetwo-image interval value, which is prior to the conversion to thedefocus amount and applying various correction values. In this case,however, since the result of moving object prediction cannot beobtained, the following determination processing is performed.

At this time, a determination unit 216 b performs determination (fifthdetermination) on whether or not the two-image interval value having apositive value satisfying the relation of (minimum value of absolutevalue of positive two-image interval value)≤(minimum value of absolutevalue of negative two-image interval value×constant) exists. In the casewhere a two-image interval value satisfying the fifth determinationexists, a block indicating the two-image interval value is selected. Onthe other hand, in the case where a two-image interval value thatsatisfies the fifth determination does not exist, a block indicating aminimum value of an absolute value of a negative two-image intervalvalue is selected.

According to at least one embodiment described above, it is possible toprovide a focusing apparatus capable of selecting an appropriateautofocus (AF) area and performing AF, a control method of the focusingapparatus, and a recording medium storing a focus adjustment program.

A change of the order of the processing or the steps i n each processingillustrated by the flowcharts is possible. Addition or deletion of aprocessing or a step is also possible. The processing is executed by thecorresponding programs stored in the interchangeable lens 100 or insidethe camera body 200. Each of the programs may be stored in advance inthe interchangeable lens 100, inside the camera body 200, or in anotherstorage medium. The programs may be stored in various ways; they may bestored before shipment, may be stored in a distributed storage medium,or may be stored through a communication line, such as the Internet.

Additional advantages and modifications will readily occur to thoseskilled in the art. Therefore, the invention in its broader aspects isnot limited to the specific details and representative embodiments shownand described herein. Accordingly, various modifications may be madewithout departing from the spirit or scope of the general inventiveconcept as defined by the appended claims and their equivalents.

What is claimed is:
 1. A focusing apparatus detecting a defocus amountrepeatedly for each of a plurality of AF areas and selecting an AF areabased on the defocus amount to perform focus adjustment, wherein thefocusing apparatus comprises processing circuitry that is configured to:calculate a moving object prediction equation based on a history of aplurality of the repeatedly detected defocus amounts; perform a firstdetermination as to whether or not the moving object prediction equationmay be established, the moving object prediction equation beingdetermined as being established when a divergence amount between thedefocus amount equal to or larger than a predetermined number includedin the history and the calculated moving object prediction equation isequal to or lower than a predetermined value, and a second determinationas to whether a driving direction of a focus lens calculated from themoving object prediction equation is a close-range direction or aninfinite direction; and in a case where the moving object predictionequation is determined as being established in the first determination,and the driving direction is determined as being the close-rangedirection in the second determination, select an AF area indicating adefocus amount closest to the moving object prediction equation amongthe latest defocus amounts detected for the plurality of AF areas. 2.The focusing apparatus according to claim 1, wherein the processingcircuitry further performs a third determination as to whether or not adefocus amount that is a minimum value of an absolute value of apositive defocus amount, and is a defocus amount smaller than apredetermined factor of times of a minimum value of an absolute value ofa negative defocus amount exists among the plurality of detected defocusamounts, or as to whether or not the positive defocus amount issufficiently small, and, in which case precision of the moving objectprediction equation is insufficient in the second determination, or inwhich case the driving direction is determined as an infinite directionin the second determination, the processing circuitry selects an AF areathat indicates the defocus amount satisfying the third determination. 3.The focusing apparatus according to claim 2, wherein, in a case wherethe defocus amount that satisfies the third determination does not existwhen the moving object prediction equation is determined as not beingestablished in the first determination or when the driving direction isdetermined as the infinite direction in the second determination, theprocessing circuitry selects an AF area indicating the minimum value ofthe absolute value of the negative defocus amount.
 4. The focusingapparatus according to claim 1, further comprising a focusinginstruction unit that instructs a start of focus adjustment, wherein theprocessing circuitry selects an AF area indicating a maximum value of apositive defocus amount among the plurality of defocus amounts until aninstruction to start focus adjustment is issued from the focusinginstruction unit, or until a focus determination is once made after thestart instruction is issued.
 5. The focusing apparatus according toclaim 1, wherein the processing circuitry further sets a sensitivity offocus adjustment, and, in a case where the set sensitivity is higherthan a predetermined value, preferentially selects an AF area indicatinga positive defocus amount among the plurality of defocus amounts.
 6. Thefocusing apparatus according to claim 1, further comprising trackingcircuitry for tracking a subject, wherein the processing circuitryselects an AF area based on a defocus amount indicated by the AF areawithin a predetermined range centered on a tracking position of thetracking circuitry.
 7. The focusing apparatus according to claim 1,further comprising face detection circuity for detecting a face, whereinthe processing circuitry selects an AF area based on a defocus amountindicated by the AF area within a range of a face detected by the facedetection circuitry.
 8. The focusing apparatus according to claim 7,further comprising: a focusing instruction unit that instructs a startof focus adjustment; a reliability determination circuitry thatdetermines reliability regarding the detection of the defocus amount;and pupil detection circuitry that detects a pupil within the range ofthe face detected by the face detection circuitry, wherein theprocessing circuitry selects an AF area corresponding to a position of apupil within the range of the face among the plurality of defocusamounts, or an AF area with high reliability until an instruction tostart focus adjustment is issued from the focusing instruction unit, oruntil a focus determination is once made after the start instruction isissued.
 9. The focusing apparatus according to claim 1, furthercomprising a focusing instruction unit that instructs a start of focusadjustment, wherein the processing circuitry performs the focusadjustment by correcting the defocus amount indicated by the selected AFarea to a positive side by a predetermined amount.
 10. The focusingapparatus according to claim 1, further comprising a focusinginstruction unit that instructs a start of focus adjustment, wherein theprocessing circuitry performs focus determination by correcting athreshold for the focus determination to a negative side.
 11. Thefocusing apparatus according to claim 1, further comprising a storageunit that stores an optical correction amount relating to a defocusamount, wherein the processing circuitry calculates the moving objectprediction equation based on a history of a defocus amount obtained bycorrecting the detected defocus amount by the optical correction amount,and selects an AF area based on the corrected defocus amount.
 12. Thefocusing apparatus according to claim 1, wherein the processingcircuitry further performs evaluation of accuracy of the moving objectprediction equation in addition to the first determination.
 13. A methodfor controlling a focusing apparatus, the focusing apparatus detecting adefocus amount repeatedly for each of a plurality of AF areas andselecting an AF area based on the defocus amount to perform focusadjustment, the method comprising: calculating a moving objectprediction equation based on a history of a plurality of the repeatedlydetected defocus amounts; performing a first determination as to whetheror not the moving object prediction equation is established, the movingobject prediction equation being determined as being established when adivergence amount between the defocus amount equal to or larger than apredetermined number included in the history and the calculated movingobject prediction equation is equal to or lower than a predeterminedvalue, and a second determination as to whether a driving direction of afocus lens calculated from the moving object prediction equation is aclose-range direction or an infinite direction; and in a case where themoving object prediction equation is determined as being established inthe first determination, and the driving direction is determined as theclose-range direction in the second determination, selecting an AF areaindicating a defocus amount closest to the moving object predictionequation among the latest defocus amounts detected for the plurality ofAF areas.
 14. The method according to claim 13, further comprisingperforming a third determination as to whether or not a defocus amountthat is a minimum value of an absolute value of a positive defocusamount, and is a defocus amount smaller than a predetermined factor oftimes of a minimum value of an absolute value of a negative defocusamount exists among the detected plurality of defocus amounts, or as towhether or not the positive defocus amount is sufficiently small,wherein the selecting the AF area further includes, in a case whereprecision of the moving object prediction equation is insufficient inthe second determination, or in a case where the driving direction isdetermined as an infinite direction in the second determination,selecting an AF area that indicates the defocus amount satisfying thethird determination.
 15. The method according to claim 14, wherein theselecting the AF area further includes, in a case where the defocusamount that satisfies the third determination does not exist in a casewhere the moving object prediction equation is determined as not beingestablished in the first determination, or in a case where the drivingdirection is determined as the infinite direction in the seconddetermination, selecting an AF area that indicates the minimum value ofthe absolute value of the negative defocus amount.
 16. The methodaccording to claim 13, further comprising starting focus adjustment inresponse to an instruction to start focus adjustment, wherein theselecting the AF area further includes selecting an AF area indicating amaximum value of a positive defocus amount among the plurality ofdefocus amounts until a start of focus adjustment is instructed, oruntil a focus determination is once made after the start instruction isissued.
 17. The method according to claim 13, further comprising settinga sensitivity of focus adjustment, wherein the selecting the AF areaincludes preferentially selecting an AF area indicating a positivedefocus amount among the plurality of defocus amounts in a case wherethe set sensitivity is higher than a predetermined value.
 18. Acomputer-readable non-transitory storage medium storing a focusadjustment program for causing a computer to repeatedly detect a defocusamount for each of a plurality of AF areas, and to select the AF areaused for focus adjustment based on the defocus amount, wherein the focusadjustment program comprises: calculating a moving object predictionequation based on a history of a plurality of the repeatedly detecteddefocus amounts; performing a first determination as to whether or notthe moving object prediction equation is satisfied, the moving objectprediction equation being determined as being established when adivergence amount between the defocus amount equal to or larger than apredetermined number included in the history and the calculated movingobject prediction equation is equal to or lower than a predeterminedvalue, and a second determination as to whether a driving direction of afocus lens calculated from the moving object prediction equation is aclose-range direction or an infinite direction; and in a case where themoving object prediction equation is determined as being established inthe first determination, and the driving direction is determined as theclose-range direction in the second determination, selecting an AF areaindicating a defocus amount closest to the moving object predictionequation among the latest defocus amounts detected for the plurality ofAF areas.
 19. The computer-readable non-transitory storage mediumstoring the focus adjustment program according to claim 18, wherein thefocus adjustment program further includes performing a thirddetermination as to whether or not a defocus amount that is a minimumvalue of an absolute value of a positive defocus amount, and is adefocus amount smaller than a predetermined factor of times of a minimumvalue of an absolute value of a negative defocus amount exists among theplurality of detected defocus amounts, or as to whether or not thepositive defocus amount is sufficiently small, wherein the selecting theAF area further includes, in a case where precision of the moving objectprediction equation is insufficient in the second determination, or in acase where the driving direction is determined as an infinite directionin the second determination, selecting an AF area that indicates thedefocus amount satisfying the third determination.
 20. Thecomputer-readable non-transitory storage medium storing the focusadjustment program according to claim 19, wherein the selecting the AFarea further includes, in a case where the defocus amount that satisfiesthe third determination does not exist in a case where the moving objectprediction equation is determined as not being established in the firstdetermination, or in a case where the driving direction is determined asthe infinite direction in the second determination, selecting an AF areathat indicates the minimum value of the absolute value of the negativedefocus amount.